package com.sy.dao;

import com.sy.entity.UserInfo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;


/**
 * @description: 码起 自动生成代码
 * @author: 小毛
 * @create: 2020-11-25 22:00:26
 */
public interface UserInfoDao {
    /*新增*/
    @Insert("insert into user_info (id,headphone,level,bankcard,balance,coupon) values(#{id},#{headphone},#{level},#{bankcard},#{balance},#{coupon})")
    int insert(UserInfo userInfo);

    /*删除*/
    @Delete("delete from user_info where id=#{id}")
    int deleteById(int id);
    /*查询全部*/
    @Select("select * from user_info")
    List<UserInfo> all();


    //初始化
    @Insert("insert into t_userdetail (uid,flag) values(#{uid},1)")
    int insertInit(int uid);
}